﻿<%@ Page Title="Онлайн заказы" Language="VB" MasterPageFile="~/adminnew/Layout.master" AutoEventWireup="false" CodeFile="OnlineOrders.aspx.vb" Inherits="AdminNewOnlineOrders" %>
<%@ Import Namespace="System.Globalization" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    <a href="/adminnew/onlineorders.aspx" class="btn btn-success pull-right" style="margin-top: 20px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;Обновить</a>
    <h2 class="page-header" style="margin: 20px 0 10px 0;"><%=Master.Page.Title%> в течение 3 часов (всего <%=total %>)</h2>

    <%If orders.Count <> 0 Then%>
    <table class="table table-bordered table-hover table-condensed table-striped" style="border: none; border-top: 1px solid #ddd;">
        <thead>
            <tr>
                <th width="45px;">№</th>
                <%--<th>Тел. клиента</th>--%>
                <th>Телефон клиента / Откуда / Куда / Примечание</th>
                <th width="105px">Дата заказа</th>
                <th>Ожидание</th>
                <th>Таксисты</th>
                <%--<th width="160px">Примечание</th>--%>
            </tr>
        </thead>
        <tbody>
            <% Dim index = 1%>
            <%For Each o In orders%>
            <tr>
                <td><%=index%></td>
                <%--<td><%=o.order_user_phone%></td>--%>
                <td>Телефон клиента: <%=o.order_user_phone %><br />
                    Город: <%Dim cityname As String
                               If IsNothing(o.torders) <> True And o.torders.Count > 0 Then
                                   cityname = o.torders.FirstOrDefault().taxist.cities.city_name
                               End If%>
                    <%=cityname%><br />
                    Пункт А: <%=o.order_from_address%><br />
                    Пункт Б: <%=o.order_to_address%><br />
                    Примечание: <%=IIf(o.order_comment<> "Примечаний нет!",o.order_comment,"")%>
                </td>
                <td><%=CType(o.order_create, DateTime).AddHours(3).ToString("dd MMMM yyyy г. HH:mm", New CultureInfo("Ru-ru"))%></td>
                <td><%=o.order_time%> мин</td>
                <%--<td><%=IIf(o.orders.order_comment="Примечаний нет!","",(o.orders.order_comment))%></td>--%>
                <th>
                    <table class="table table-bordered table-hover table-condensed table-striped" style="border: none; border-top: 1px solid #ddd; font-size: 13px;">
                        <thead>
                            <tr>
                                <th width="45px;">№</th>
                                <th>ФИО</th>
                                <th>Телефон</th>
                                <th>Цена</th>
                                <th>Статус</th>
                            </tr>
                        </thead>
                        <tbody>
                            <% Dim tindex = 1%>
                            <%For Each t In o.torders%>
                            <tr>
                                <td><%=tindex%></td>
                                <td><%=t.taxist.taxi_lastname + " " + t.taxist.taxt_firstname%></td>
                                <td>+<%=t.taxist.taxi_phone%></td>
                                <td><%=IIf(t.torder_price <> 0,t.torder_price.ToString(),"")%></td>
                                <td><%=t.torder_status %></td>
                            </tr>
                            <%tindex += 1
                            Next%>
                        </tbody>
                    </table>
                </th>
            </tr>
            <%index += 1
            Next%>
        </tbody>
    </table>
    <%Else%>
    <p>Пока заказов не имеется...</p>
    <%End If%>

    <script type="text/javascript">
        $(document).ready(function () {
            setActivePage(3);
        });
    </script>

</asp:Content>

